import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials';
import BoldPlugin from '@ckeditor/ckeditor5-basic-styles/src/bold';
import ItalicPlugin from '@ckeditor/ckeditor5-basic-styles/src/italic';
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline'
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough'
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript'
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript'
import LinkPlugin from '@ckeditor/ckeditor5-link/src/link';
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat'
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'
import Heading from '@ckeditor/ckeditor5-heading/src/heading'
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote'
import HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline'
import List from '@ckeditor/ckeditor5-list/src/list'
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment'

import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor'
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor'
import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily'
import FontSize from '@ckeditor/ckeditor5-font/src/fontsize'

import Table from '@ckeditor/ckeditor5-table/src/table'
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';

import Image from '@ckeditor/ckeditor5-image/src/image'
// import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption'
import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize'
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar'
import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters';
import SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials';
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
import Indentblock from '@ckeditor/ckeditor5-indent/src/indentblock';
import Indentediting from '@ckeditor/ckeditor5-indent/src/indentediting';
import Removeformat from '@ckeditor/ckeditor5-remove-format/src/removeformat';

// import Fullscreen from '../plugin/fullscreen'
import Insertimage from '../plugin/insertimage'
import Htmlsource from '../plugin/htmlsource'


export default class ClassicEditor2 extends ClassicEditorBase {}

ClassicEditor2.builtinPlugins = [
    EssentialsPlugin,
    Autoformat,
    PasteFromOffice,
    BoldPlugin,
    ItalicPlugin,
    LinkPlugin,
    ParagraphPlugin,
    Underline,
    Strikethrough,
    Heading,
    BlockQuote,
    HorizontalLine,

    FontColor,
    FontBackgroundColor,
    List,
    Alignment,
    Table,
    TableToolbar,
    TableProperties,
    TableCellProperties,
    // Fullscreen,
    FontFamily,
    FontSize,
    Htmlsource,
    Image,
    // ImageCaption,
    ImageResize,
    ImageToolbar,
    SpecialCharacters,
    SpecialCharactersEssentials,
    Insertimage,
    Subscript,
    Superscript,
    Indent,
    Indentblock,
    Indentediting,
    Removeformat
];

ClassicEditor2.defaultConfig = {
    toolbar: {
        items: [
            // 'fullscreen',
            'htmlsource',
            '|',
            'undo',
            'redo',
            '|',
            'heading',
            'fontfamily',
            'fontsize',
            '|',
            'bold',
            'italic',
            'underline',
            'strikethrough',
            'subscript',
            'superscript',
            'indent',
            'outdent',
            '|',
            'link',
            'blockQuote',
            'horizontalLine',
            'removeFormat',
            '|',
            'fontcolor',
            'fontbackgroundcolor',
            '|',
            'bulletedList',
            'numberedList',
            'alignment',
            'insertTable',
            'specialCharacters',
            '|',
            'insertimage',
        ]
    },
    heading: {
        options: [
            {model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph'},
            {model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1'},
            {model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2'},
            {model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3'},
            {model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4'},
            {model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5'},
            {model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6'}
        ]
    },
    table: {
        contentToolbar: [
            'tableColumn',
            'tableRow',
            'mergeTableCells',
            'tableProperties',
            'tableCellProperties'
        ],
        tableProperties: {
            // ...
        },
        tableCellProperties: {
            // ...
        }
    },
    // This value must be kept in sync with the language defined in webpack.config.js.
    language: 'zh-cn',
    link: {
        addTargetToExternalLinks: true
    },
    fontFamily: {
        options: [
            'default',
            '宋体',
            '微软雅黑',
            '楷体',
            '黑体',
            '隶书',
            'Arial, Helvetica, sans-serif',
            'Courier New, Courier, monospace',
            'Georgia, serif',
            'Lucida Sans Unicode, Lucida Grande, sans-serif',
            'Tahoma, Geneva, sans-serif',
            'Times New Roman, Times, serif',
            'Trebuchet MS, Helvetica, sans-serif',
            'Verdana, Geneva, sans-serif'
        ]
    },
    fontSize: {
        options: ['10px', '11px', '12px', '14px', '16px', '18px', '20px', '24px', '36px']
    }
};